package com.sta.oldman.controller;

import com.sta.oldman.common.ResponseVO;
import com.sta.oldman.enums.ExceptionEnum;
import com.sta.oldman.model.req.BindEmailReq;
import com.sta.oldman.model.req.BindingEmailReq;
import com.sta.oldman.model.req.ExceptionReq;
import com.sta.oldman.service.ExceptionService;
import com.sta.oldman.utils.JWT;
import io.jsonwebtoken.Claims;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import lombok.Data;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: LunBoWang
 * @description: TODO
 * @date: 2025/7/21 下午7:20
 * @version: 1.0
 */
@RestController
public class ExceptionController {

    @Resource
    ExceptionService exceptionService;

    @RequestMapping("/exception")
    public ResponseVO GetException(@RequestBody @Validated ExceptionReq req,
                                   HttpServletRequest request){
        req.setImei("1");
        return exceptionService.getException(req);
    }

    @RequestMapping("/bindingEmail")
    public ResponseVO bindingEmail(@RequestBody @Validated BindEmailReq req){
        return exceptionService.bindingEmail(req);
    }
}
